package com.gxa.worker.recycling.controller;

import com.gxa.core.recycling.anno.NeedToken;
import com.gxa.core.recycling.common.JsonResult;
import com.gxa.core.recycling.pojo.Advice;
import com.gxa.core.recycling.pojo.BenMessage;
import com.gxa.worker.recycling.service.NoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;

import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.Condition;

/**
 * @author 廖泓宇
 * @date 2021/12/2 11:21
 */
@CrossOrigin
@RestController
@RequestMapping("/notice")
@Api(value = "本然公告全查询接口")
public class NoticeController {

    @Autowired
    NoticeService noticeService;


    @PostMapping("/selectAllByNotice")
    @ApiOperation("本然公告全查")
    @NeedToken
    public Map selectAllByNotice(){
        List<BenMessage> advice = noticeService.selectAllByNotice();

        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode("200");
        jsonResult.setData(advice);
        return jsonResult.getDataMap();
    }

}
